﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Content/Master.Master" Inherits="System.Web.Mvc.ViewPage<SCS.Core.ViewModels.DetailOrderViewModels>" %>
<%@ Import Namespace="SCS.Core" %>
<%@ Import Namespace="SCS.Core.Models" %>
<%@ Import Namespace="SCS.Core.ViewModels" %>
<%@ Import Namespace="SCS.Core.Controllers" %>
<%@ Import Namespace="SCSService" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Chi tiết đơn hàng
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<script language="javascript">

    function SaveStatus(dropDownList, id) {
        var selectedReport = dropDownList.options[dropDownList.selectedIndex];
        var selects = selectedReport.value;
        actionChangeStatus(selects, id);
    }
    function actionChangeStatus(values, id) {
        var url = '<%=Url.Action("ChangeStatusShipment","HomeMaster")%>' + '/' + id + '/' + values;
        $.getJSON(url, function (outStr) {
            $('#statusID' + id).val(outStr);
        });
    }

</script>

<% using (Html.BeginForm("DetailOrder", "HomeMaster", FormMethod.Post, new { id = "sendFileForm", enctype = "multipart/form-data" }))
   {%>
    <div class="clear"></div>
    <div class="column full">
    <div class="box ">
        
		<h2 class="box-header"></h2>
		<div class="box-content">

                    <div id="grid">			    						               
				                <table class="display" id="tabledata" >
                                <thead>
					                <tr>
                                        <th>
                                            Mã sản phẩm
                                        </th>
						                <th>
								           Tên sản phẩm
                                        </th>
                                        <th>
                                         Serial thẻ
                                        </th> 
                                        	               
						                <th>
							                
								                Ngày mua
						                </th>
                                       
                                        <th>
							               
								                Số điện thoại
						                </th>
                                        <th>
							                
								                Email
						                </th>
                                
                                        <th>
							             
								                Tổng tiền
						                </th>                                     
					                </tr>
                                               
                                </thead>
                                <% if (Model.lstDetailOrder.Count() == 0)
                                   { %>
			                        <tbody>
                                        <tr>
                                            <td colspan="6">
                                               Không tìm thấy 
                                            </td>
                                        </tr>
                                    </tbody>
		                        <% } else { %>
                                <tbody>
					                <% foreach (var item in Model.lstDetailOrder) { %>
				    
						                <tr>						                
							            <td>
                                        <%: item.ProductID %>
                                        </td>
                                        <td>
                                            <%: HomeMasterModel.GetProductNameID(item.ProductID).ToString() %>
                                        </td>
                                        <td>
                                        <%=item.Serial %>
                                        </td>
                                        <td>
                                            <%= item.CreateDate %>
                                        </td>
                                            
                                        <td>
							                <%: item.Phone %>
						                </td>
                                        <td>
							                <%: item.Email %>
						                </td>
                                 
                                        <td>
							               <%: item.Total %>
						                </td>
                                        
							       
                                       
                                          
						             </tr>
				    
					                <% } %>
					            </tbody>
                                <% } %>
                                  <tr style="visibility:hidden; height=5px;" >
                                        <td>
                                            
                                        </td>

                                        <td >
                                            
                                        </td>
                                        
                                        <td >
                                            From: <%=Html.TextBoxFor(m=>m.StartDate,new { @class = "form-field datepicker"}) %>
                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            To: <%=Html.TextBoxFor(m=>m.EndDate,new { @class = "form-field datepicker"}) %>
                                        </td>
                                        
                                        <td>
                                            <%
                                                List<SelectListItem> statusSearch = new List<SelectListItem>();
                                                statusSearch.AddRange(new SelectListItem[] { 
                                                new SelectListItem{ Text = "start", Value = "0" },
                                                new SelectListItem{ Text = "CheckOut", Value = "1" }
                                                });
                                                %>

                                                <%=Html.DropDownListFor(m => m.StatusSearch, statusSearch)%> 
                                        </td>
                                        <td>
                                            <input type="submit" value="Tìm kiếm" class="button themed"/>
                                        </td>
                                    </tr>
				                </table>
			                <!-- data -->

		                
	                </div>  <!-- grid -->	
                
               
	    </div>
	</div>
    <div class="clear"></div>
    </div>    
<% } %>

</asp:Content>
 